#ifndef BUYER_H
#define BUYER_H
#include"observer.h"
#include<iostream>
#include<string>
#include<typeinfo>
#include"stock.h"
using namespace std;
class Buyer : public Observer
{
private:
    string m_name;
public:
    Buyer(shared_ptr<Stock> sub = nullptr, string name = "神秘人某某") : Observer(sub), m_name(name)
    {}
    void update()
    {
        cout << m_name << "收到消息！";
        cout << ((Stock*)((this->m_sub).get()))->getName();
        cout << "价格变化幅度大于等于5%！" << endl;
    }
};
#endif